Просмотр исходного кода

Merge pull request #1184 from nightscout/fix/live-activity-widget-strings

Fix COB string, localize live activity widget item labels
Deniz Cengiz 15 часов назад
Родитель
Сommit
702d2b8fb1

+ 16 - 0
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -65939,6 +65939,9 @@
         }
       }
     },
+    "Carbs on Board (COB)" : {
+      "comment" : "Live Activity widget icon label for Carbs on Board (COB)"
+    },
     "Carbs On Board (COB)" : {
       "localizations" : {
         "bg" : {
@@ -127956,6 +127959,9 @@
         }
       }
     },
+    "Glucose and Trend, no Delta" : {
+      "comment" : "Live Activity widget icon label for Glucose and Trend, no Delta"
+    },
     "Glucose Calculation" : {
       "localizations" : {
         "bg" : {
@@ -131473,6 +131479,9 @@
         }
       }
     },
+    "Glucose, Trend, Delta" : {
+      "comment" : "Live Activity widget icon label for Glucose, Trend, Delta"
+    },
     "Glucose: %@" : {
       "comment" : "Glucose: %@",
       "extractionState" : "manual",
@@ -145984,6 +145993,9 @@
         }
       }
     },
+    "Insulin on Board (IOB)" : {
+      "comment" : "Live Activity widget icon label for Insulin on Board (IOB)"
+    },
     "Insulin On Board (IOB)" : {
       "localizations" : {
         "bg" : {
@@ -151788,6 +151800,9 @@
         }
       }
     },
+    "Last Updated" : {
+      "comment" : "Live Activity widget icon label for Last Updated"
+    },
     "Latest dev: %@" : {
       "localizations" : {
         "bg" : {
@@ -262918,6 +262933,7 @@
       }
     },
     "Total Daily Dose" : {
+      "comment" : "Live Activity widget icon label for Total Daily Dose",
       "localizations" : {
         "bg" : {
           "stringUnit" : {

+ 15 - 6
Trio/Sources/Modules/LiveActivitySettings/View/LiveActivityWidgetConfiguration.swift

@@ -383,17 +383,26 @@ enum LiveActivityItem: String, CaseIterable, Identifiable {
     var displayName: String {
         switch self {
         case .currentGlucoseLarge:
-            return "Glucose and Trend, no Delta"
+            return String(
+                localized: "Glucose and Trend, no Delta",
+                comment: "Live Activity widget icon label for Glucose and Trend, no Delta"
+            )
         case .currentGlucose:
-            return "Glucose, Trend, Delta"
+            return String(
+                localized: "Glucose, Trend, Delta",
+                comment: "Live Activity widget icon label for Glucose, Trend, Delta"
+            )
         case .iob:
-            return "Insulin on Board (IOB)"
+            return String(
+                localized: "Insulin on Board (IOB)",
+                comment: "Live Activity widget icon label for Insulin on Board (IOB)"
+            )
         case .cob:
-            return "Carbs on Board (IOB)"
+            return String(localized: "Carbs on Board (COB)", comment: "Live Activity widget icon label for Carbs on Board (COB)")
         case .updatedLabel:
-            return "Last Updated"
+            return String(localized: "Last Updated", comment: "Live Activity widget icon label for Last Updated")
         case .totalDailyDose:
-            return "Total Daily Dose"
+            return String(localized: "Total Daily Dose", comment: "Live Activity widget icon label for Total Daily Dose")
         }
     }
 }